<?php 
	include_once '../common/header.php';
?>
<script>

function resetPassword()
{
	var emailId = $("#txtEmailId").val();
	
	var error = "";
	
	if(emailId.length==0)
	{
		error +="Email Id can not be blank.";
		error +="\n";
	}
	if(error.length!=0)
	{
		alert(error);
	}
	else
	{
		$.post("doLogin.php",{action:"password-reset",emailId:emailId},function(data){

			if(data!="0")
			{
				
			}
			else
			{
				window.open("password-reset.php?message=linkmail",'_self');
			}
		},"text");
	}
}

</script>
<div class="body">
<!-- Login Area -->
<table width="1000" id="maintable" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<div id="popupContactAdminPage">
		<p id="contactArea">
		<?php //print $_SESSION["UserName"];?>
			<form id="frmLogin" name="frmLogin" method="post">
			<table cellpadding="2px" cellspacing="1px" bgcolor="#95A2AD" width="460px" class="tableBorder">
			    <tr>
			        <td colspan="2" bgcolor="#302C3B">&nbsp;</td>
			    </tr>
			    <tr>
			        <td colspan="2" class="label" align="center">
			        
			        </td>
			    </tr>
			    <tr>
			        <td align="center" colspan="2">
			            <img src="images/lost-password.png" border="0" align="absbottom" height="40" width="40" />&nbsp;
			            <span class="message" style="color: navy;">Forgot Your Password? Reset it!</span><br />
			              <span style="color: #F2F2F2">A reset password link will be sent to you email id.</span>
			        </td>
			    </tr>                  
			    <tr>
			        <td colspan="2" class="label">&nbsp;</td>
			        <label id="message"></label>
			    </tr>
			    <tr>
			    	<?php if($_REQUEST["message"] != "linkmail")  { ?>
			        <td class="label" align="right" width="30%" style="color: navy">Email Id:</td>
			        <td align="left" width="70%">
			        
			        <input type="text" id="txtEmailId" name="txtEmailId" style="width: 250px;color: navy" maxlength="120"/>
			        
			        </td>
			        <?php } else { ?>
			        <td colspan="2" class="label" align="center" width="30%" style="color: navy">
			        	<label style="color: #F00;">Password Reset mail is sent to your email id. In case of not receiving the mail please try again after 24 hours.</label>
			        </td>
			        <?php } ?>
			    </tr>
			    
			    <tr>
			    	<td colspan="2">&nbsp;</td>
			    </tr>
			    <tr>
			        <td align="center" colspan="2">
				        <input <?php if($_REQUEST['message']=="linkmail") { ?> disabled="disabled" <?php }?> class="normalBtn" type="button" value="Reset Password >>" id="btnLogin" name="btnLogin" onclick="resetPassword();" />
				        
			        </td>
			    </tr>                  
			    
			    <tr>
			        <td colspan="2" class="label" align="right">
			        <div style="height: 6px;">&nbsp;</div>
			      
			    </tr>
			                      
			</table>			
			</form>
		</p>	
	</div>
</td>
</tr>
</table>
<!-- Login Area Ends -->
</div>

<?php 
  include_once '../common/footer.php';
?>